home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14882 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Largest effective integer.
  5. Date: Mon, 15 Apr 96 23:36:44 GMT
  6. Organization: none
  7. Message-ID: <829611404snz@genesis.demon.co.uk>
  8. References: <4ke5gu$o7u@airdmhor.gen.nz> <smryanDpnDDn.418@netcom.com> <4kqtii$3r2@airdmhor.gen.nz>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4kqtii$3r2@airdmhor.gen.nz>
  15.            gumboot@airdmhor.gen.nz "Simon Hosie" writes:
  16.  
  17. >@#$%!?!:
  18. >> Measly little 32 bit integers and reals. I grew up on 60 and 48 bit integers,
  19. >> 120 bit doubles. And 65535 bit integers.
  20. >
  21. >> In other words, this all machine specfic. Look in <limits.h> if your
  22. >> compiler has one. 
  23. >
  24. >  Yes, but char short int and long have minimums defined for them, I was
  25. >hoping that there is a minimum for the mantissa of a float or double.
  26.  
  27. The mantissa represents a value between 0 and 1. The standard does define
  28. minimum limits on its precision (well roughly in terms of the number
  29. of decimal digits that can distinguished):
  30.  
  31.  FLT_DIG       6
  32.  DBL_DIG       10
  33.  LDBL_DIG      10
  34.  
  35. These don't guarantee that integers can be represented exactly though.
  36.  
  37. >  Is long double an ANSI type, by the way?  I didn't think it was, but
  38. >Watcom supports it even though it's the same size as a double.
  39.  
  40. long double is an ANSI defined type. E.g. a standard printf and scanf
  41. conversion specifier for it is %Lf
  42.  
  43. -- 
  44. -----------------------------------------
  45. Lawrence Kirby | fred@genesis.demon.co.uk
  46. Wilts, England | 70734.126@compuserve.com
  47. -----------------------------------------
  48.